package com.zhang.family_doctor.service;

import com.github.pagehelper.PageInfo;
import com.google.zxing.WriterException;
import com.zhang.family_doctor.dto.TeamDto;
import com.zhang.family_doctor.entity.ApplyJoinTeam;
import com.zhang.family_doctor.entity.R;
import com.zhang.family_doctor.entity.Team;
import com.zhang.family_doctor.entity.TeamJoined;
import com.zhang.family_doctor.vo.TeamIJoinedVO;
import com.zhang.family_doctor.vo.TeamManageVO;
import com.zhang.family_doctor.vo.TeamVO;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

public interface TeamService {

    /**
     * 新增医生团队
     * @param teamDto
     * @param request
     * @return
     */
    R<String> save(TeamDto teamDto, HttpServletRequest request) throws IOException, WriterException;

    /**
     * 编辑团队
     * @param teamDto
     * @return
     */
    R<String> updateTeam(TeamDto teamDto);

    /**
     * 给团队添加服务包
     * @param teamDto
     * @return
     */
    R<String> savePackages(TeamDto teamDto);

    /**
     * 启用或禁用团队
     * @param team
     * @return
     */
    R<String> enableOrDisable(Team team);

    /**
     * 解散团队
     * @param id
     * @return
     */
    R<String> dissolutionTeam(Integer id);

    /**
     * 申请加入团队
     * @param applyJoinTeam
     * @param request
     * @return
     */
    R<String> applyToJoinTeam(ApplyJoinTeam applyJoinTeam, HttpServletRequest request);

    /**
     * 通过或者拒绝
     * @param applyJoinTeam
     * @return
     */
    R<String> passOrReject(ApplyJoinTeam applyJoinTeam);

    /**
     * 团队成员退出团队
     * @param id
     * @return
     */
    R<String> signOutTeam(Integer id);

    /**
     * 分页查询我管理的团队
     * @param pageNum
     * @param pageSize
     * @param request
     * @return
     */
    R<PageInfo<TeamVO>> getTeam(Integer pageNum, Integer pageSize,Integer mechanismId,String teamName, HttpServletRequest request);

    /**
     * 分页查询我加入的团队
     * @param pageNum
     * @param pageSize
     * @param request
     * @return
     */
    R<PageInfo<TeamVO>> getTeamJoined(Integer pageNum, Integer pageSize,Integer mechanismId,String teamName, HttpServletRequest request);

    /**
     * 查看我管理的团队详情
     * @param id
     * @return
     */
    R<TeamManageVO> getTeamManageDetails(Integer id);

    /**
     * 查看我加入的团队详情
     * @param id
     * @return
     */
    R<TeamIJoinedVO> getTeamIJoinedDetails(Integer id);

    /**
     * 根据机构id查询团团队
     * @param mechanismId
     * @return
     */
    R<List<Team>> getTeamByMechanismId(Integer mechanismId);

    /**
     * 根据团队id查询队员
     * @param teamId
     * @return
     */
    R<List<TeamJoined>> getTeamJoinedByTeamId(Integer teamId);
}
